{%extends 'reportes/reportes_base.html'%}
{%load humanize%}
{%block extrahead%}
    <title>Relacion Bancos</title>
{%endblock%}

{%block titlecontent%}
<h2>Relacion de Bancos</h2>
{%endblock%}

{%block maincontent%}
<table class="report_list">
    <tr>

        <th>Chq.</th>
	<th>Fact.</th>
        <th>RFC</th>
        <th>Nombre</th>
        <th>Concepto</th>
        {%if gran_tot.base_0 != 0%}<th>Base 0%</th>{%endif%}
        {%if gran_tot.sub_11 != 0%}<th>Sub. 11%</th>{%endif%}
        {%if gran_tot.sub_16 != 0%}<th>Sub. 16%</th>{%endif%}
        {%if gran_tot.descuento != 0%}<th>Desc.</th>{%endif%}
        {%if gran_tot.descuento_iva != 0%}<th>IVA Desc.</th>{%endif%}
        {%if gran_tot.iva_11 != 0%}<th>IVA 11%</th>{%endif%}
        {%if gran_tot.iva_16 != 0%}<th>IVA 16%</th>{%endif%}
        {%if gran_tot.ret_iva != 0%}<th>Ret. IVA</th>{%endif%}
        {%if gran_tot.ret_isr != 0%}<th>Ret. ISR</th>{%endif%}
        <th>Importe</th>
    </tr>
    {%for res in resumen%}
    <tr>
        <td colspan="13" class="prov_info">{{res.cuenta.banco.nombre}} - {{res.cuenta.numero}}</td>
    </tr>
    {%for concepto in res.conceptos%}
    <tr class="conceptos">
        <td class="small">{{concepto.cheque.referencia}} </td>
	<td>{{concepto.referencia}}</td>
        <td class="small">{{concepto.proveedor.rfc}}</td>
        <td class="small">{{concepto.proveedor.nombre}}</td>
        <td class="small">{{concepto.get_tipo_display}}</td>
        {%if gran_tot.base_0 != 0%}<td class="number">{{concepto.get_base_0|intcomma}}</td>{%endif%}
        {%if gran_tot.sub_11 != 0%}<td class="number">{{concepto.get_sub_11|intcomma}}</td>{%endif%}
        {%if gran_tot.sub_16 != 0%}<td class="number">{{concepto.get_sub_16|intcomma}}</td>{%endif%}
        {%if gran_tot.descuento != 0%}<td class="number">{{concepto.get_desc|intcomma}}</td>{%endif%}
        {%if gran_tot.descuento_iva != 0%}<td class="number">{{concepto.get_iva_desc|intcomma}}</td>{%endif%}
        {%if gran_tot.iva_11 != 0%}<td class="number">{{concepto.get_iva_11|intcomma}}</td>{%endif%}
        {%if gran_tot.iva_16 != 0%}<td class="number">{{concepto.get_iva_16|intcomma}}</td>{%endif%}
        {%if gran_tot.ret_iva != 0%}<td class="number">{%if concepto.ret_iva != 0%}{{concepto.ret_iva|intcomma}}{%endif%}</td>{%endif%}
        {%if gran_tot.ret_isr != 0%}<td class="number">{%if concepto.ret_isr != 0%}{{concepto.ret_isr|intcomma}}{%endif%}</td>{%endif%}
        <td class="number">{{concepto.bancos|intcomma}}</td>
    </tr>
    {%endfor%}
    <tr class="parcial">
        <td colspan="5">TOTALES</td>
        {%if gran_tot.base_0 != 0%}<td class="number">{%if res.totales.base_0 != 0%}{{res.totales.base_0|intcomma}}{%endif%}</td>{%endif%}
        {%if gran_tot.sub_11 != 0%}<td class="number">{%if res.totales.sub_11 != 0%}{{res.totales.sub_11|intcomma}}{%endif%}</td>{%endif%}
        {%if gran_tot.sub_16 != 0%}<td class="number">{%if res.totales.sub_16 != 0%}{{res.totales.sub_16|intcomma}}{%endif%}</td>{%endif%}
        {%if gran_tot.descuento != 0%}<td class="number">{%if res.totales.descuento != 0%}{{res.totales.descuento|intcomma}}{%endif%}</td>{%endif%}
        {%if gran_tot.descuento_iva != 0%}<td class="number">{%if res.totales.descuento_iva != 0%}{{res.totales.descuento_iva|intcomma}}{%endif%}</td>{%endif%}
        {%if gran_tot.iva_11 != 0%}<td class="number">{%if res.totales.iva_11 != 0%}{{res.totales.iva_11|intcomma}}{%endif%}</td>{%endif%}
        {%if gran_tot.iva_16 != 0%}<td class="number">{%if res.totales.iva_16 != 0%}{{res.totales.iva_16|intcomma}}{%endif%}</td>{%endif%}
        {%if gran_tot.ret_iva != 0%}<td class="number">{%if res.totales.ret_iva != 0%}{{res.totales.ret_iva|intcomma}}{%endif%}</td>{%endif%}
        {%if gran_tot.ret_isr != 0%}<td class="number">{%if res.totales.ret_isr != 0%}{{res.totales.ret_isr|intcomma}}{%endif%}</td>{%endif%}
        <td class="number">{{res.totales.importe|intcomma}}</td>
    </tr>
<tr>
    <td></td>
</tr>
<tr>
    <td></td>
</tr>
<tr>
    <td></td>
</tr>
<tr>
    <td></td>
</tr>
    {%endfor%}

<tr>
    <td></td>
</tr>
<tr>
    <td></td>
</tr>
<tr>
    <td></td>
</tr>
<tr>
    <td></td>
</tr>
    <tr class="parcial">
        <td colspan="5">GRAN TOTAL</td>
        {%if gran_tot.base_0 != 0%}
        <td class="number">{%if gran_tot.base_0 != 0%}{{gran_tot.base_0|intcomma}}{%endif%}</td>
        {%endif%}
        {%if gran_tot.sub_11 != 0%}
        <td class="number">{%if gran_tot.sub_11 != 0%}{{gran_tot.sub_11|intcomma}}{%endif%}</td>
        {%endif%}
        {%if gran_tot.sub_16 != 0%}
        <td class="number">{%if gran_tot.sub_16 != 0%}{{gran_tot.sub_16|intcomma}}{%endif%}</td>
        {%endif%}
        {%if gran_tot.descuento != 0%}
        <td class="number">{%if gran_tot.descuento != 0%}{{gran_tot.descuento|intcomma}}{%endif%}</td>
        {%endif%}
        {%if gran_tot.descuento_iva != 0%}
        <td class="number">{%if gran_tot.descuento_iva != 0%}{{gran_tot.descuento_iva|intcomma}}{%endif%}</td>
        {%endif%}
        {%if gran_tot.iva_11 != 0%}
        <td class="number">{%if gran_tot.iva_11 != 0%}{{gran_tot.iva_11|intcomma}}{%endif%}</td>
        {%endif%}
        {%if gran_tot.iva_16 != 0%}
        <td class="number">{%if gran_tot.iva_16 != 0%}{{gran_tot.iva_16|intcomma}}{%endif%}</td>
        {%endif%}
        {%if gran_tot.ret_iva != 0%}
        <td class="number">{%if gran_tot.ret_iva != 0%}{{gran_tot.ret_iva|intcomma}}{%endif%}</td>
        {%endif%}
        {%if gran_tot.ret_isr != 0%}
        <td class="number">{%if gran_tot.ret_isr != 0%}{{gran_tot.ret_isr|intcomma}}{%endif%}</td>
        {%endif%}
        <td class="number">{{gran_tot.importe|intcomma}}</td>
    </tr>


</table>

<br>
<br>
<br>

{%endblock%}

